package com.k.kc.util.base64.base64url;

/**
 * Created by 170623910 on 2021/9/21.
 */
public class Exception extends java.lang.Exception {

    private static final long serialVersionUID = 1L;

    private final Message message;

    public Exception(Message msg) {
        message = msg;
    }

    public Exception(Message msg, Throwable t) {
        super(t);
        message = msg;
    }

    public Exception(Throwable cause) {
        super(cause);
        message = null;
    }

    public String getCode() {
        if (null != message) {
            return message.getCode();
        }
        return null;
    }

    @Override
    public String getMessage() {
        if (null != message) {
            return message.toString();
        }
        return null;
    }
}
